//
//  HeadCell.m
//  口袋
//
//  Created by why on 15/5/25.
//  Copyright (c) 2015年 口袋. All rights reserved.
//

#import "HeadCell.h"
#import "DKNightVersion.h"

#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height * 0.4
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

@implementation HeadCell

- (void)dealloc
{
    [_imageView1 release];
    [_label release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [DKNightVersionManager addClassToSet:self.class];
        self.nightBackgroundColor = UIColorFromRGB(0x343434);
        [self createView];
    }
    return self;
}

- (void)createView
{
    _imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT * 0.85)];
    [self.contentView addSubview:_imageView1];
    [_imageView1 release];
    
    
    _label = [[UILabel alloc] initWithFrame:CGRectMake(10, HEIGHT * 0.85, WIDTH, HEIGHT * 0.15)];
    [self.contentView addSubview:_label];
    _label.nightTextColor = [UIColor lightGrayColor];
    _label.nightBackgroundColor = UIColorFromRGB(0x343434);
    [_label release];
}

@end
